import React from 'react';
import { Icon } from 'antd-mobile';

class MyIcon extends React.Component {
  static defaultProps = {
    type: 'check',
  };
  static propTypes = {
    type: React.PropTypes.string,
    size: React.PropTypes.oneOf(['xxs', 'xs', 'sm', 'md', 'lg']),
  };

  render() {
    const iconSvg = require(`../../svg/${this.props.type}.svg`);
    return (
      <Icon
        {...this.props}
        type={iconSvg}
      />
    );
  }
}

export default MyIcon;
